/* eslint-disable */
import { request } from 'umi';

/** 获取部门列表数据 GET /api/currentUser */
export async function departList(params: any, options?: { [key: string]: any }) {
    return request<{
        data: API.CurrentUser;
    }>('/api/depart/list', {
        method: 'GET',
        params,
        ...(options || {}),
    });
}


/**获取用户列表数据的方法  GET  /api/user/list */
export async function userList(params: {
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
},
    options?: { [key: string]: any }) {
    return request<{
        data: API.CurrentUser;
    }>('/api/users', {
        method: 'GET',
        params,
        ...(options || {}),
    });
}

/**添加用固话的Api的方法 */
export async function userAdd(params: any, options?: { [key: string]: any }) {
    return request('/api/users', {
        method: "POST",
        data: params,
        ...(options || {}),
    })
}

//删除用户的的基本操作
export async function userDel(params: any, options?: { [key: string]: any }) {
    return request('/api/users', {
        method: "delete",
        data: params,
        ...(options || {}),
    })
}

//修改用户的基本操作方式
export async function userEdit(params: any, options?: { [key: string]: any }) {
    return request("/api/users", {
        method: "PUT",
        data: params,
        ...(options || {}),
    })
}